/**
 * PermissionDialog module
 */

 var consts = require("../../../util/consts");
 var storage = require("../../../util/storage");
 var dataProvider = require("../provider/dataProvider");
 var React = require("react");
 var PermissionDialog = React.createClass({
    getInitialProps: function (){
        return {
            root: {}
        }
    },
    handleOnCloseDialog: function (){
        var root = this.props.root;
        root.closeDialog();
    },
    render: function (){
        var root = this.props.root;

        var rStyle = {
            width: "200px",
            height: "110px",
            display: "block",
            borderRadius:'5px',
            overflow:'hidden',
        };
        var type = this.props.data;
        var content = '';
        if(type == consts.WIDGET_TYPE.LOOKERS){
            content = $._('one AR only one lookers')
        } else if( type == consts.WIDGET_TYPE.REDBAG){
            content = $._("one AR only one redBag")
        } else if( type == consts.WIDGET_TYPE.HOPEBANK){
            content = $._("one AR only one HopeBank");
        }
        return (
            <div id="permissionDialog" ref="dialog" style={rStyle} className="btg-modal widget-form" onselectstart="return false">
                <div className="no_permission_tip">
                    <div>{content}</div>
                    <div className="confirm_nopermission">
                        <span onClick={this.handleOnCloseDialog}>{$._('Confirm')}</span>
                    </div>
                </div>
            </div>
        )
    }
 });

 module.exports = PermissionDialog;
